define(function(require){
	var main = require('/static/main.js');
	var m = new main();
	function Cont(){
		this.Fun._init();
	}
	Cont.prototype.Fun = {
		_init:function(){
		    this.getList();
		},
		getList:function(){
            m.ajax(m.baseUrl+'/site/cum-getList',this.data,function(ret){
                if(ret.status == 1){
                    var str = '';
                    if(ret.data.ModelList.length <= 0){
                        m.dealwith('#shop_list_cont','icon-i4','暂无该商品');
                        $('#shop_list_cont').show();
                        $('.shop_list_cont').hide();
                    }else{
                        $('#shop_list_cont').hide();
                        $('.shop_list_cont').show();
                        ret.data.ModelList.forEach(function(v,k){
                            str+='<li class="special_item transition">\
                                    <a href="/site/detial?index='+$_GET['index']+'&productid='+v.ProductId+'&HotBrandId='+HotBrandId+'" target="_blank"><p><img src="'+v.Src+'" > </p></a>\
                                    <div class="special_info">\
                                        <div class="fl">\
                                            <div>\
                                                <span class="jia">&yen; <span class="price">'+v.Price+'</span></span>\
                                                <del>&yen;'+v.MarketPrice+'</del>'
                                                if(v.StockCount > 0){
                                                    str+='<span class="zhe">'+(v.Discount*10).toFixed(1)+'折</span>'
                                                }else{
                                                    str+='<span class="zhe" style="background:#a1a1a1">已售罄</span>'
                                                }
                                            str+='</div>\
                                            <a href="/site/detial?productid='+v.ProductId+'"><p class="special_name">'+v.ProductName+'</p></a>\
                                        </div>\
                                        <div class="clear"></div>\
                                    </div>\
                                </li>'
                        })
                    }
                    $('.special_wrap ul').html(str);
                    this.data.TotalCount = ret.data.TotalCount;
                    var total_page = Math.ceil(ret.data.TotalCount/this.data.PageSize)
                    $('.item .current').html(ret.data.TotalCount);
                    $('.item .now').html(this.data.PageNo);
                    this.data.TotalCountPage = total_page;
                    $('.item .total_page_num').html(this.data.TotalCountPage);
                    if(this.data.PageNo == 1){
                        $('.M-box1').pagination({
                            totalData:this.data.TotalCount,
                            showData:this.data.PageSize,
                            coping:true,
                            callback:this.getCallbackPage,
                        });
                    }
                }
            }.bind(this))
        },
      
		bindEvent:function(){
		}


	}
	var a = new Cont();

})